# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname='perl-text-csv'
_dist="Text-CSV"
pkgver=2.02
pkgrel=1
pkgdesc="comma-separated values manipulator"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
url="https://metacpan.org/dist/$_dist"
source=("https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/${_dist}-${pkgver}.tar.gz")
md5sums=('b25b9c6bb45c128484393efe082a8791')
sha512sums=('0efb9396f5f02c3fc478f5d88a13bdfd1c615dde4ff3b671bc95e380e107b497634dc17e282dbfe3956a98a0d28f8156fe5d851483595c21d29674d535fcdaf6')

unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT

build() {
    cd $_dist-$pkgver
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd $_dist-$pkgver
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd $_dist-$pkgver
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
